3.65 \(\int (a+b \tan (e+f x)) (c+d \tan (e+f x))^3 (A+B \tan (e+f x)+C \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=389 \[ \frac{d \tan (e+f x) \left (A \left (2 a c d+b \left (c^2-d^2\right )\right )+a \left (B c^2-B d^2-2 c C d\right )-b \left (2 B c d+c^2 C-C d^2\right )\right )}{f}-\frac{\log (\cos (e+f x)) \left (A \left (3 a c^2 d-a d^3+b c^3-3 b c d^2\right )+a \left (B c^3-3 B c d^2-3 c^2 C d+C d^3\right )-b \left (3 B c^2 d-B d^3+c^3 C-3 c C d^2\right )\right )}{f}+x \left (a \left (A c^3-3 A c d^2-3 B c^2 d+B d^3-c^3 C+3 c C d^2\right )-b \left (d (A-C) \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right )\right )+\frac{(a B+A b-b C) (c+d \tan (e+f x))^3}{3 f}+\frac{(c+d \tan (e+f x))^2 (a A d+a B c-a C d+A b c-b B d-b c C)}{2 f}-\frac{(-5 a C d-5 b B d+b c C) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^4}{5 d f} \]

[Out]

(a*(A*c^3 - c^3*C - 3*B*c^2*d - 3*A*c*d^2 + 3*c*C*d^2 + B*d^3) - b*((A - C)*d*(3*c^2 - d^2) + B*(c^3 - 3*c*d^2
)))*x - ((A*(b*c^3 + 3*a*c^2*d - 3*b*c*d^2 - a*d^3) - b*(c^3*C + 3*B*c^2*d - 3*c*C*d^2 - B*d^3) + a*(B*c^3 - 3
*c^2*C*d - 3*B*c*d^2 + C*d^3))*Log[Cos[e + f*x]])/f + (d*(a*(B*c^2 - 2*c*C*d - B*d^2) - b*(c^2*C + 2*B*c*d - C
*d^2) + A*(2*a*c*d + b*(c^2 - d^2)))*Tan[e + f*x])/f + ((A*b*c + a*B*c - b*c*C + a*A*d - b*B*d - a*C*d)*(c + d
*Tan[e + f*x])^2)/(2*f) + ((A*b + a*B - b*C)*(c + d*Tan[e + f*x])^3)/(3*f) - ((b*c*C - 5*b*B*d - 5*a*C*d)*(c +
 d*Tan[e + f*x])^4)/(20*d^2*f) + (b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])^4)/(5*d*f)

________________________________________________________________________________________

Rubi [A]  time = 0.705025, antiderivative size = 387, normalized size of antiderivative = 0.99, number of steps used = 6, number of rules used = 5, integrand size = 43, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.116, Rules used = {3637, 3630, 3528, 3525, 3475} \[ \frac{d \tan (e+f x) \left (2 a A c d+a B \left (c^2-d^2\right )-2 a c C d+A b \left (c^2-d^2\right )-b \left (2 B c d+c^2 C-C d^2\right )\right )}{f}-\frac{\log (\cos (e+f x)) \left (A \left (3 a c^2 d-a d^3+b c^3-3 b c d^2\right )+a \left (B c^3-3 B c d^2-3 c^2 C d+C d^3\right )-b \left (3 B c^2 d-B d^3+c^3 C-3 c C d^2\right )\right )}{f}-x \left (-a \left (A c^3-3 A c d^2-3 B c^2 d+B d^3-c^3 C+3 c C d^2\right )+b d (A-C) \left (3 c^2-d^2\right )+b B \left (c^3-3 c d^2\right )\right )+\frac{(a B+A b-b C) (c+d \tan (e+f x))^3}{3 f}+\frac{(c+d \tan (e+f x))^2 (a A d+a B c-a C d+A b c-b B d-b c C)}{2 f}-\frac{(-5 a C d-5 b B d+b c C) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^4}{5 d f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])^3*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

-((b*(A - C)*d*(3*c^2 - d^2) + b*B*(c^3 - 3*c*d^2) - a*(A*c^3 - c^3*C - 3*B*c^2*d - 3*A*c*d^2 + 3*c*C*d^2 + B*
d^3))*x) - ((A*(b*c^3 + 3*a*c^2*d - 3*b*c*d^2 - a*d^3) - b*(c^3*C + 3*B*c^2*d - 3*c*C*d^2 - B*d^3) + a*(B*c^3
- 3*c^2*C*d - 3*B*c*d^2 + C*d^3))*Log[Cos[e + f*x]])/f + (d*(2*a*A*c*d - 2*a*c*C*d + A*b*(c^2 - d^2) + a*B*(c^
2 - d^2) - b*(c^2*C + 2*B*c*d - C*d^2))*Tan[e + f*x])/f + ((A*b*c + a*B*c - b*c*C + a*A*d - b*B*d - a*C*d)*(c
+ d*Tan[e + f*x])^2)/(2*f) + ((A*b + a*B - b*C)*(c + d*Tan[e + f*x])^3)/(3*f) - ((b*c*C - 5*b*B*d - 5*a*C*d)*(
c + d*Tan[e + f*x])^4)/(20*d^2*f) + (b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])^4)/(5*d*f)

Rule 3637

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])
^(n + 1))/(d*f*(n + 2)), x] - Dist[1/(d*(n + 2)), Int[(c + d*Tan[e + f*x])^n*Simp[b*c*C - a*A*d*(n + 2) - (A*b
 + a*B - b*C)*d*(n + 2)*Tan[e + f*x] - (a*C*d*(n + 2) - b*(c*C - B*d*(n + 2)))*Tan[e + f*x]^2, x], x], x] /; F
reeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] &&  !LtQ[n, -1]

Rule 3630

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e + f*x])
^m*Simp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0]
&&  !LeQ[m, -1]

Rule 3528

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d
*(a + b*Tan[e + f*x])^m)/(f*m), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^3 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac{b C \tan (e+f x) (c+d \tan (e+f x))^4}{5 d f}-\frac{\int (c+d \tan (e+f x))^3 \left (b c C-5 a A d-5 (A b+a B-b C) d \tan (e+f x)+(b c C-5 b B d-5 a C d) \tan ^2(e+f x)\right ) \, dx}{5 d}\\ &=-\frac{(b c C-5 b B d-5 a C d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^4}{5 d f}-\frac{\int (c+d \tan (e+f x))^3 (5 (b B-a (A-C)) d-5 (A b+a B-b C) d \tan (e+f x)) \, dx}{5 d}\\ &=\frac{(A b+a B-b C) (c+d \tan (e+f x))^3}{3 f}-\frac{(b c C-5 b B d-5 a C d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^4}{5 d f}-\frac{\int (c+d \tan (e+f x))^2 (5 d (b B c+b (A-C) d-a (A c-c C-B d))-5 d (A b c+a B c-b c C+a A d-b B d-a C d) \tan (e+f x)) \, dx}{5 d}\\ &=\frac{(A b c+a B c-b c C+a A d-b B d-a C d) (c+d \tan (e+f x))^2}{2 f}+\frac{(A b+a B-b C) (c+d \tan (e+f x))^3}{3 f}-\frac{(b c C-5 b B d-5 a C d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^4}{5 d f}-\frac{\int (c+d \tan (e+f x)) \left (5 d \left (a \left (c^2 C+2 B c d-C d^2-A \left (c^2-d^2\right )\right )+b \left (2 c (A-C) d+B \left (c^2-d^2\right )\right )\right )-5 d \left (2 a A c d-2 a c C d+A b \left (c^2-d^2\right )+a B \left (c^2-d^2\right )-b \left (c^2 C+2 B c d-C d^2\right )\right ) \tan (e+f x)\right ) \, dx}{5 d}\\ &=-\left (b (A-C) d \left (3 c^2-d^2\right )+b B \left (c^3-3 c d^2\right )-a \left (A c^3-c^3 C-3 B c^2 d-3 A c d^2+3 c C d^2+B d^3\right )\right ) x+\frac{d \left (2 a A c d-2 a c C d+A b \left (c^2-d^2\right )+a B \left (c^2-d^2\right )-b \left (c^2 C+2 B c d-C d^2\right )\right ) \tan (e+f x)}{f}+\frac{(A b c+a B c-b c C+a A d-b B d-a C d) (c+d \tan (e+f x))^2}{2 f}+\frac{(A b+a B-b C) (c+d \tan (e+f x))^3}{3 f}-\frac{(b c C-5 b B d-5 a C d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^4}{5 d f}-\left (-A \left (b c^3+3 a c^2 d-3 b c d^2-a d^3\right )+b \left (c^3 C+3 B c^2 d-3 c C d^2-B d^3\right )-a \left (B c^3-3 c^2 C d-3 B c d^2+C d^3\right )\right ) \int \tan (e+f x) \, dx\\ &=-\left (b (A-C) d \left (3 c^2-d^2\right )+b B \left (c^3-3 c d^2\right )-a \left (A c^3-c^3 C-3 B c^2 d-3 A c d^2+3 c C d^2+B d^3\right )\right ) x-\frac{\left (A \left (b c^3+3 a c^2 d-3 b c d^2-a d^3\right )-b \left (c^3 C+3 B c^2 d-3 c C d^2-B d^3\right )+a \left (B c^3-3 c^2 C d-3 B c d^2+C d^3\right )\right ) \log (\cos (e+f x))}{f}+\frac{d \left (2 a A c d-2 a c C d+A b \left (c^2-d^2\right )+a B \left (c^2-d^2\right )-b \left (c^2 C+2 B c d-C d^2\right )\right ) \tan (e+f x)}{f}+\frac{(A b c+a B c-b c C+a A d-b B d-a C d) (c+d \tan (e+f x))^2}{2 f}+\frac{(A b+a B-b C) (c+d \tan (e+f x))^3}{3 f}-\frac{(b c C-5 b B d-5 a C d) (c+d \tan (e+f x))^4}{20 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^4}{5 d f}\\ \end{align*}

Mathematica [C]  time = 6.34188, size = 297, normalized size = 0.76 \[ \frac{b C \tan (e+f x) (c+d \tan (e+f x))^4}{5 d f}-\frac{\frac{(-5 a C d-5 b B d+b c C) (c+d \tan (e+f x))^4}{4 d f}+\frac{5 \left ((a B+A b-b C) \left (-6 d^2 \left (6 c^2-d^2\right ) \tan (e+f x)-12 c d^3 \tan ^2(e+f x)-3 i (c-i d)^4 \log (\tan (e+f x)+i)+3 i (c+i d)^4 \log (-\tan (e+f x)+i)-2 d^4 \tan ^3(e+f x)\right )+3 (-a A d+a B c+a C d+A b c+b B d-b c C) \left (6 c d^2 \tan (e+f x)+(-d+i c)^3 \log (-\tan (e+f x)+i)-(d+i c)^3 \log (\tan (e+f x)+i)+d^3 \tan ^2(e+f x)\right )\right )}{6 f}}{5 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])^3*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

(b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])^4)/(5*d*f) - (((b*c*C - 5*b*B*d - 5*a*C*d)*(c + d*Tan[e + f*x])^4)/(4*d
*f) + (5*(3*(A*b*c + a*B*c - b*c*C - a*A*d + b*B*d + a*C*d)*((I*c - d)^3*Log[I - Tan[e + f*x]] - (I*c + d)^3*L
og[I + Tan[e + f*x]] + 6*c*d^2*Tan[e + f*x] + d^3*Tan[e + f*x]^2) + (A*b + a*B - b*C)*((3*I)*(c + I*d)^4*Log[I
 - Tan[e + f*x]] - (3*I)*(c - I*d)^4*Log[I + Tan[e + f*x]] - 6*d^2*(6*c^2 - d^2)*Tan[e + f*x] - 12*c*d^3*Tan[e
 + f*x]^2 - 2*d^4*Tan[e + f*x]^3)))/(6*f))/(5*d)

________________________________________________________________________________________

Maple [B]  time = 0.017, size = 994, normalized size = 2.6 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))*(c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x)

[Out]

1/2/f*ln(1+tan(f*x+e)^2)*C*a*d^3+1/f*B*arctan(tan(f*x+e))*a*d^3-1/2/f*ln(1+tan(f*x+e)^2)*C*b*c^3-1/2/f*B*tan(f
*x+e)^2*b*d^3+1/f*C*a*c^3*tan(f*x+e)+1/2/f*ln(1+tan(f*x+e)^2)*B*a*c^3+1/4/f*B*tan(f*x+e)^4*b*d^3-1/3/f*C*tan(f
*x+e)^3*b*d^3-1/2/f*C*tan(f*x+e)^2*a*d^3+1/5/f*C*b*d^3*tan(f*x+e)^5-1/f*A*b*d^3*tan(f*x+e)-1/f*B*a*d^3*tan(f*x
+e)+1/3/f*B*tan(f*x+e)^3*a*d^3+1/2/f*C*tan(f*x+e)^2*b*c^3+1/f*A*arctan(tan(f*x+e))*a*c^3+1/2/f*A*tan(f*x+e)^2*
a*d^3+1/4/f*C*tan(f*x+e)^4*a*d^3+1/3/f*A*tan(f*x+e)^3*b*d^3+1/2/f*ln(1+tan(f*x+e)^2)*B*b*d^3+1/f*B*b*c^3*tan(f
*x+e)+1/f*C*b*d^3*tan(f*x+e)+1/f*A*arctan(tan(f*x+e))*b*d^3-1/2/f*ln(1+tan(f*x+e)^2)*A*a*d^3+1/2/f*ln(1+tan(f*
x+e)^2)*A*b*c^3-1/f*B*arctan(tan(f*x+e))*b*c^3-1/f*C*arctan(tan(f*x+e))*a*c^3-1/f*C*arctan(tan(f*x+e))*b*d^3-3
/f*A*arctan(tan(f*x+e))*b*c^2*d-3/f*B*arctan(tan(f*x+e))*a*c^2*d+3/f*B*arctan(tan(f*x+e))*b*c*d^2+3/f*C*arctan
(tan(f*x+e))*a*c*d^2-3/2/f*ln(1+tan(f*x+e)^2)*B*b*c^2*d-3/2/f*ln(1+tan(f*x+e)^2)*C*a*c^2*d+3/2/f*ln(1+tan(f*x+
e)^2)*C*b*c*d^2-3/f*A*arctan(tan(f*x+e))*a*c*d^2-3/2/f*ln(1+tan(f*x+e)^2)*A*b*c*d^2-3/2/f*ln(1+tan(f*x+e)^2)*B
*a*c*d^2+1/f*C*tan(f*x+e)^3*b*c^2*d+3/2/f*B*tan(f*x+e)^2*a*c*d^2-3/f*C*a*c*d^2*tan(f*x+e)-3/f*C*b*c^2*d*tan(f*
x+e)+3/f*A*a*c*d^2*tan(f*x+e)+3/f*A*b*c^2*d*tan(f*x+e)+3/f*B*a*c^2*d*tan(f*x+e)+3/2/f*A*tan(f*x+e)^2*b*c*d^2-3
/2/f*C*tan(f*x+e)^2*b*c*d^2-3/f*B*b*c*d^2*tan(f*x+e)+1/f*B*tan(f*x+e)^3*b*c*d^2+3/f*C*arctan(tan(f*x+e))*b*c^2
*d+3/4/f*C*tan(f*x+e)^4*b*c*d^2+3/2/f*B*tan(f*x+e)^2*b*c^2*d+1/f*C*tan(f*x+e)^3*a*c*d^2+3/2/f*C*tan(f*x+e)^2*a
*c^2*d+3/2/f*ln(1+tan(f*x+e)^2)*A*a*c^2*d

________________________________________________________________________________________

Maxima [A]  time = 1.55974, size = 522, normalized size = 1.34 \begin{align*} \frac{12 \, C b d^{3} \tan \left (f x + e\right )^{5} + 15 \,{\left (3 \, C b c d^{2} +{\left (C a + B b\right )} d^{3}\right )} \tan \left (f x + e\right )^{4} + 20 \,{\left (3 \, C b c^{2} d + 3 \,{\left (C a + B b\right )} c d^{2} +{\left (B a +{\left (A - C\right )} b\right )} d^{3}\right )} \tan \left (f x + e\right )^{3} + 30 \,{\left (C b c^{3} + 3 \,{\left (C a + B b\right )} c^{2} d + 3 \,{\left (B a +{\left (A - C\right )} b\right )} c d^{2} +{\left ({\left (A - C\right )} a - B b\right )} d^{3}\right )} \tan \left (f x + e\right )^{2} + 60 \,{\left ({\left ({\left (A - C\right )} a - B b\right )} c^{3} - 3 \,{\left (B a +{\left (A - C\right )} b\right )} c^{2} d - 3 \,{\left ({\left (A - C\right )} a - B b\right )} c d^{2} +{\left (B a +{\left (A - C\right )} b\right )} d^{3}\right )}{\left (f x + e\right )} + 30 \,{\left ({\left (B a +{\left (A - C\right )} b\right )} c^{3} + 3 \,{\left ({\left (A - C\right )} a - B b\right )} c^{2} d - 3 \,{\left (B a +{\left (A - C\right )} b\right )} c d^{2} -{\left ({\left (A - C\right )} a - B b\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 60 \,{\left ({\left (C a + B b\right )} c^{3} + 3 \,{\left (B a +{\left (A - C\right )} b\right )} c^{2} d + 3 \,{\left ({\left (A - C\right )} a - B b\right )} c d^{2} -{\left (B a +{\left (A - C\right )} b\right )} d^{3}\right )} \tan \left (f x + e\right )}{60 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/60*(12*C*b*d^3*tan(f*x + e)^5 + 15*(3*C*b*c*d^2 + (C*a + B*b)*d^3)*tan(f*x + e)^4 + 20*(3*C*b*c^2*d + 3*(C*a
 + B*b)*c*d^2 + (B*a + (A - C)*b)*d^3)*tan(f*x + e)^3 + 30*(C*b*c^3 + 3*(C*a + B*b)*c^2*d + 3*(B*a + (A - C)*b
)*c*d^2 + ((A - C)*a - B*b)*d^3)*tan(f*x + e)^2 + 60*(((A - C)*a - B*b)*c^3 - 3*(B*a + (A - C)*b)*c^2*d - 3*((
A - C)*a - B*b)*c*d^2 + (B*a + (A - C)*b)*d^3)*(f*x + e) + 30*((B*a + (A - C)*b)*c^3 + 3*((A - C)*a - B*b)*c^2
*d - 3*(B*a + (A - C)*b)*c*d^2 - ((A - C)*a - B*b)*d^3)*log(tan(f*x + e)^2 + 1) + 60*((C*a + B*b)*c^3 + 3*(B*a
 + (A - C)*b)*c^2*d + 3*((A - C)*a - B*b)*c*d^2 - (B*a + (A - C)*b)*d^3)*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.2365, size = 861, normalized size = 2.21 \begin{align*} \frac{12 \, C b d^{3} \tan \left (f x + e\right )^{5} + 15 \,{\left (3 \, C b c d^{2} +{\left (C a + B b\right )} d^{3}\right )} \tan \left (f x + e\right )^{4} + 20 \,{\left (3 \, C b c^{2} d + 3 \,{\left (C a + B b\right )} c d^{2} +{\left (B a +{\left (A - C\right )} b\right )} d^{3}\right )} \tan \left (f x + e\right )^{3} + 60 \,{\left ({\left ({\left (A - C\right )} a - B b\right )} c^{3} - 3 \,{\left (B a +{\left (A - C\right )} b\right )} c^{2} d - 3 \,{\left ({\left (A - C\right )} a - B b\right )} c d^{2} +{\left (B a +{\left (A - C\right )} b\right )} d^{3}\right )} f x + 30 \,{\left (C b c^{3} + 3 \,{\left (C a + B b\right )} c^{2} d + 3 \,{\left (B a +{\left (A - C\right )} b\right )} c d^{2} +{\left ({\left (A - C\right )} a - B b\right )} d^{3}\right )} \tan \left (f x + e\right )^{2} - 30 \,{\left ({\left (B a +{\left (A - C\right )} b\right )} c^{3} + 3 \,{\left ({\left (A - C\right )} a - B b\right )} c^{2} d - 3 \,{\left (B a +{\left (A - C\right )} b\right )} c d^{2} -{\left ({\left (A - C\right )} a - B b\right )} d^{3}\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 60 \,{\left ({\left (C a + B b\right )} c^{3} + 3 \,{\left (B a +{\left (A - C\right )} b\right )} c^{2} d + 3 \,{\left ({\left (A - C\right )} a - B b\right )} c d^{2} -{\left (B a +{\left (A - C\right )} b\right )} d^{3}\right )} \tan \left (f x + e\right )}{60 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/60*(12*C*b*d^3*tan(f*x + e)^5 + 15*(3*C*b*c*d^2 + (C*a + B*b)*d^3)*tan(f*x + e)^4 + 20*(3*C*b*c^2*d + 3*(C*a
 + B*b)*c*d^2 + (B*a + (A - C)*b)*d^3)*tan(f*x + e)^3 + 60*(((A - C)*a - B*b)*c^3 - 3*(B*a + (A - C)*b)*c^2*d
- 3*((A - C)*a - B*b)*c*d^2 + (B*a + (A - C)*b)*d^3)*f*x + 30*(C*b*c^3 + 3*(C*a + B*b)*c^2*d + 3*(B*a + (A - C
)*b)*c*d^2 + ((A - C)*a - B*b)*d^3)*tan(f*x + e)^2 - 30*((B*a + (A - C)*b)*c^3 + 3*((A - C)*a - B*b)*c^2*d - 3
*(B*a + (A - C)*b)*c*d^2 - ((A - C)*a - B*b)*d^3)*log(1/(tan(f*x + e)^2 + 1)) + 60*((C*a + B*b)*c^3 + 3*(B*a +
 (A - C)*b)*c^2*d + 3*((A - C)*a - B*b)*c*d^2 - (B*a + (A - C)*b)*d^3)*tan(f*x + e))/f

________________________________________________________________________________________

Sympy [A]  time = 5.76826, size = 1001, normalized size = 2.57 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))**3*(A+B*tan(f*x+e)+C*tan(f*x+e)**2),x)

[Out]

Piecewise((A*a*c**3*x + 3*A*a*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) - 3*A*a*c*d**2*x + 3*A*a*c*d**2*tan(e + f*
x)/f - A*a*d**3*log(tan(e + f*x)**2 + 1)/(2*f) + A*a*d**3*tan(e + f*x)**2/(2*f) + A*b*c**3*log(tan(e + f*x)**2
 + 1)/(2*f) - 3*A*b*c**2*d*x + 3*A*b*c**2*d*tan(e + f*x)/f - 3*A*b*c*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + 3*A
*b*c*d**2*tan(e + f*x)**2/(2*f) + A*b*d**3*x + A*b*d**3*tan(e + f*x)**3/(3*f) - A*b*d**3*tan(e + f*x)/f + B*a*
c**3*log(tan(e + f*x)**2 + 1)/(2*f) - 3*B*a*c**2*d*x + 3*B*a*c**2*d*tan(e + f*x)/f - 3*B*a*c*d**2*log(tan(e +
f*x)**2 + 1)/(2*f) + 3*B*a*c*d**2*tan(e + f*x)**2/(2*f) + B*a*d**3*x + B*a*d**3*tan(e + f*x)**3/(3*f) - B*a*d*
*3*tan(e + f*x)/f - B*b*c**3*x + B*b*c**3*tan(e + f*x)/f - 3*B*b*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) + 3*B*b
*c**2*d*tan(e + f*x)**2/(2*f) + 3*B*b*c*d**2*x + B*b*c*d**2*tan(e + f*x)**3/f - 3*B*b*c*d**2*tan(e + f*x)/f +
B*b*d**3*log(tan(e + f*x)**2 + 1)/(2*f) + B*b*d**3*tan(e + f*x)**4/(4*f) - B*b*d**3*tan(e + f*x)**2/(2*f) - C*
a*c**3*x + C*a*c**3*tan(e + f*x)/f - 3*C*a*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) + 3*C*a*c**2*d*tan(e + f*x)**
2/(2*f) + 3*C*a*c*d**2*x + C*a*c*d**2*tan(e + f*x)**3/f - 3*C*a*c*d**2*tan(e + f*x)/f + C*a*d**3*log(tan(e + f
*x)**2 + 1)/(2*f) + C*a*d**3*tan(e + f*x)**4/(4*f) - C*a*d**3*tan(e + f*x)**2/(2*f) - C*b*c**3*log(tan(e + f*x
)**2 + 1)/(2*f) + C*b*c**3*tan(e + f*x)**2/(2*f) + 3*C*b*c**2*d*x + C*b*c**2*d*tan(e + f*x)**3/f - 3*C*b*c**2*
d*tan(e + f*x)/f + 3*C*b*c*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + 3*C*b*c*d**2*tan(e + f*x)**4/(4*f) - 3*C*b*c*
d**2*tan(e + f*x)**2/(2*f) - C*b*d**3*x + C*b*d**3*tan(e + f*x)**5/(5*f) - C*b*d**3*tan(e + f*x)**3/(3*f) + C*
b*d**3*tan(e + f*x)/f, Ne(f, 0)), (x*(a + b*tan(e))*(c + d*tan(e))**3*(A + B*tan(e) + C*tan(e)**2), True))

________________________________________________________________________________________

Giac [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="giac")

[Out]

Timed out